package com.knoya.chejian.pda.module.chache

import android.content.Context
import com.knoya.chejian.pda.contacts.Contacts
import com.knoya.chejian.pda.minterface.OnUserDataInterface
import com.knoya.chejian.pda.util.HttpUtil
import org.xutils.http.RequestParams
import org.xutils.x

class ChacheM {
    fun chuku(context : Context, pallet_num : String, code:Int, uid:String, onuserdatainterface : OnUserDataInterface){
        val params = RequestParams(Contacts.CHACHEGARHER)
        HttpUtil.getparams(context, params)
        HttpUtil.addtoken(params)
        params.addBodyParameter("pallet_num", pallet_num.trim(), Contacts.BOUNDARY)
        params.addBodyParameter("code",code, Contacts.BOUNDARY)
        params.addBodyParameter("uid",uid, Contacts.BOUNDARY)

        params.addHeader("ACCEPT", "application/json")
        x.http().post<String>(params, HttpUtil.Call(context,onuserdatainterface))
    }
}